projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
62896dc
)
regulator: pbias: don't evaluate variable before assignment
author
Heinrich Schuchardt
<
[email protected]
>
Sun, 18 Mar 2018 11:01:06 +0000
(12:01 +0100)
committer
Tom Rini
<
[email protected]
>
Sat, 7 Apr 2018 00:45:28 +0000
(20:45 -0400)
We should not evaluate the value of reg before its value is set.
Signed-off-by: Heinrich Schuchardt <
[email protected]
>
Reviewed-by: Simon Glass <
[email protected]
>
drivers/power/regulator/pbias_regulator.c
patch
|
blob
|
history
diff --git
a/drivers/power/regulator/pbias_regulator.c
b/drivers/power/regulator/pbias_regulator.c
index 116b7f480a796d61150179220e0af4d37b1ea55a..adf589b224969443e2f172347b70dd54d16fbe67 100644
(file)
--- a/
drivers/power/regulator/pbias_regulator.c
+++ b/
drivers/power/regulator/pbias_regulator.c
@@
-225,9
+225,6
@@
static int pbias_regulator_set_value(struct udevice *dev, int uV)
int rc;
u32 reg;
- debug("Setting %s voltage to %s\n", p->name,
- (reg & p->vmode) ? "3.0v" : "1.8v");
-
rc = pmic_read(dev->parent, 0, (uint8_t *)®, sizeof(reg));
if (rc)
return rc;
@@
-239,6
+236,9
@@
static int pbias_regulator_set_value(struct udevice *dev, int uV)
else
return -EINVAL;
+ debug("Setting %s voltage to %s\n", p->name,
+ (reg & p->vmode) ? "3.0v" : "1.8v");
+
return pmic_write(dev->parent, 0, (uint8_t *)®, sizeof(reg));
}